<!--
 * @FilePath     : /study_code/jquery/plugin-jquery-tmpl-html.html
 * @Description  : html 模板语法：编译解析 html 字符串
 * @Date         : 2025-04-21 14:41:40
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-21 14:47:46
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
  </head>
  <body>
    <div id="div_html"></div>

    <script id="html" type="text/x-jquery-tmpl">
      <div style="margin-bottom:10px;">
        <div>ID: ${id}</div>
        <div style="margin-left:10px;">NAME: {{= Name}}</div>
        <div>HANDLE:
          需要解析的数据内容：${htmlstring}
          解析后的数据内容{{html htmlstring}}
        </div>
      /div>
    </script>

    <script src="/jquery/dist/jquery.min.js"></script>
    <script src="/jquery/plugins/jquery.tmpl/lib/jquery.tmpl.min.js"></script>
    <script>
      $(function () {
        var user = {
          id: 'think8848',
          name: 'Joseph Chan',
          htmlstring: '<button>html</button>',
        }
        $('#html').tmpl(user).appendTo('#div_html')
      })
    </script>
  </body>
</html>
